package com.phpxiu.app.view.dialog;

import android.app.Dialog;
import android.content.Context;
import android.view.View;

import com.phpxiu.app.kkylive.R;
import com.phpxiu.app.view.BaseShare;
import com.phpxiu.app.view.RoomVideoRoom;

/**
 * 房间分享平台选择面板
 * Created by 吴金洲 on 2016/9/4
 */
@Deprecated
public class RoomShareMenus extends Dialog implements View.OnClickListener{

    private RoomVideoRoom room;

    public RoomShareMenus(Context context) {
        super(context,R.style.shareBoardDialog);
        init(context);
    }

    private final void init(Context context){
        setContentView(R.layout.main_room_share_menus);
        findViewById(R.id.room_share_board_view).setOnClickListener(this);
        findViewById(R.id.share_board_close).setOnClickListener(this);
        findViewById(R.id.share_wx).setOnClickListener(this);
        findViewById(R.id.share_friend).setOnClickListener(this);
        findViewById(R.id.share_wb).setOnClickListener(this);
        findViewById(R.id.share_qq).setOnClickListener(this);
        findViewById(R.id.share_zone).setOnClickListener(this);
        findViewById(R.id.share_fb).setOnClickListener(this);
        findViewById(R.id.share_tt).setOnClickListener(this);
        findViewById(R.id.share_ins).setOnClickListener(this);
        findViewById(R.id.share_google).setOnClickListener(this);
    }


    public void show(RoomVideoRoom r) {
        room=r;
        super.show();
    }

    @Override
    public void onClick(View v) {
        if(room==null||room.roomShareContent==null){
            return;
        }
        switch (v.getId()){
            case R.id.share_board_close:
            case R.id.room_share_board_view:
                break;
            case R.id.share_wx:
                room.onRequestShareContentTo(BaseShare.PLATFORM_WX,room.roomShareContent);
                break;
            case R.id.share_friend:
                room.onRequestShareContentTo(BaseShare.PLATFORM_WF, room.roomShareContent);
                break;
            case R.id.share_wb:
                room.onRequestShareContentTo(BaseShare.PLATFORM_WB, room.roomShareContent);
                break;
            case R.id.share_qq:
                room.onRequestShareContentTo(BaseShare.PLATFORM_QQ, room.roomShareContent);
                break;
            case R.id.share_zone:
                room.onRequestShareContentTo(BaseShare.PLATFORM_QZ, room.roomShareContent);
                break;
            case R.id.share_fb:
                room.onRequestShareContentTo(BaseShare.PLATFORM_FB, room.roomShareContent);
                break;
            case R.id.share_tt:
                room.onRequestShareContentTo(BaseShare.PLATFORM_TT, room.roomShareContent);
                break;
            case R.id.share_ins:
                room.onRequestShareContentTo(BaseShare.PLATFORM_INS, room.roomShareContent);
                break;
            case R.id.share_google:
                room.onRequestShareContentTo(BaseShare.PLATFORM_GG, room.roomShareContent);
                break;
        }
        dismiss();
    }

    @Override
    public void dismiss() {
        room=null;
        super.dismiss();
    }
}
